<#assign menu="authorization">
<#include "/manage/head.ftl">
<!--main content start-->
<section id="main-content">
	<section class="wrapper">
		<!-- page start-->
		<form id="update_authorization_form" class="form-horizontal" action="${BASE_PATH}/manage/authorization/update.json"  autocomplete="off"  method="post"
			enctype="multipart/form-data">
		<div class="row">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading"> 
						修改授权书
					</header>
					<div class="panel-body">
						<input type="hidden" value="${authorization.authorizationId}" name="authorizationId"/>
						<div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">名称</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="name"
                              	placeholder="名称" id="name" value="${authorization.name}">
                              </input>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">微信号</label>
                          <div class="col-sm-10">
			                   		<input type="text" style="font-size:15px;width: 300px;" class="form-control" name="weixin"
                              	placeholder="微信号" id="weixin" value="${authorization.weixin}">
                              </input>						
                          </div>
                        </div>  
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">上传证书</label>
                          <div class="col-sm-10">
                          	<img src="${BASE_PATH}/${authorization.url}" alt="img04" style="height:120px;">
                          	<input type="file" name="file"
                              	id="file" >
                          </div>
                      	</div>
                        <div class="form-group">
                      	  <div class="col-lg-offset-2 col-lg-10">
                          <button class="btn btn-shadow btn-primary" type="submit">修改</button>
                          </div>
                      </div>
					</div>
				</section>
				
			</div>
		</div>
		</form>
		<!-- page end-->
	</section>
</section>
<!--main content end-->
<script type="text/javascript">
$(function(){
	$('#update_authorization_form').ajaxForm({
		dataType : 'json',
		beforeSerialize: function($form, options) {
		},	
		success : function(data) {
			if (data.result) {
				bootbox.alert("修改成功，将刷新页面", function() {
					window.location.reload();
					
				});
			}else{
				showErrors($('#update_authorization_form'),data.errors);
			}
		}
	});
});
</script>
<#include "/manage/foot.ftl">